package com.thuanhoang.boo.model.manage;

import vn.com.hoasua.database.adbSqlHelper;
import android.annotation.SuppressLint;
import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.util.Log;

import com.hoasua.database.R;

@SuppressLint("SdCardPath")
public class BooDataBaseHelper extends adbSqlHelper {

	public BooDataBaseHelper(Context context) {
		super(context, "/data/data/"+context.getPackageName(), context.getString(R.string.database_name)+"_ext", Integer.valueOf(context.getString(R.string.database_version)));
		if(context.getString(R.string.debug).equals("true")){
			Log.e("db path", "/data/data/"+context.getPackageName());
			Log.e("db_name",context.getString(R.string.database_name)+"_ext");
			Log.e("db_version", Integer.valueOf(context.getString(R.string.database_version))+"");
		}
	}

	@Override
	public void createAdb(SQLiteDatabase db) {
		db.execSQL(getSql(ObjUserMng.TABLE,ObjUserMng.COLUMNS));
	}

	@Override
	public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
		db.execSQL("DROP TABLE IF EXISTS " + ObjUserMng.TABLE+" ;");
		createAdb(db);
	}

}
